<html>
<head>
<title>firstworks   Programming with Rudiments using the parameterstring class</title>
<link href="../css/styles.css" rel="stylesheet">
</head>
<body>

<span class="heading">Using the parameterstring class</span><br><br>

<p>Sometimes a function needs to take an arbitrary set of parameters.  For
example, a function for connecting to a database may need host, port, socket,
username and password, any of which could be omitted depending on the
database.  Though C++ support methods which take an arbitrary number of
parameters, sometimes it is more convenient to for the method to accept a
single string parameter with name/value pairs in it instead.</p>

<p>The parameterstring class provides methods for parsing and accessing
a parameter string of the following form:</p>

<blockquote>
name1='value1';name2='value2';name3='value3'
</blockquote>

<p>The single quotes are optional.  If a parameter needs to contain a single
quote, then it can be escaped as follows:</p>

<blockquote>
name='\'value\''
</blockquote>

<p>Backslashes can be similarly escaped:</p>

<blockquote>
name='\\value\\'
</blockquote>

<img src="../images/traffic_cone.png"/>

<p>Coming soon...</p>

<blockquote class="code">

<script type='text/javascript'>
<!--

-->
</script>
<font face="monospace">
<font color="#2e8b57"><b>int</b></font>&nbsp;main(<font color="#2e8b57"><b>int</b></font>&nbsp;argc,&nbsp;<font color="#2e8b57"><b>const</b></font>&nbsp;<font color="#2e8b57"><b>char</b></font>&nbsp;**argv) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="#0000ff">//&nbsp;</font><span style="background-color: #ffff00"><font color="#0000ff">FIXME</font></span><font color="#0000ff">: example...</font><br>
}<br>
</font>
<!-- vim: set foldmethod=manual : -->
</blockquote>

</body>
</html>
